<template>
  <div class="gl_contentBox gl_heightFull">
    <el-button class="bu_position" size="mini" type="success" @click="toCRMSetting()">设置</el-button>
    <el-tabs v-model="activeTab" class="gl_tabs" type="card">
      <el-tab-pane v-for="(item,index) in tabList" :key="index" :label="item.label" :name="item.name">
        <component :is="item.component" v-if="activeTab === item.name" :active-tab="activeTab" /></el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import myclientlist from './components/myclientlist';
import client from './client/index';
import analyse from './enrollmentAnalysis/index';
export default {

  data() {
    return {
      activeTab: '',
      tabList: [
        {
          label: '我的客户',
          name: 'myclientlist',
          productStatus: 'myclientlist',
          component: myclientlist
        },
        {
          label: '客户池',
          name: 'client',
          productStatus: 'client',
          component: client
        },
        {
          label: '招生分析',
          name: 'analyse',
          productStatus: 'analyse',
          component: analyse
        }
      ]
    };
  },
  created() {
    this.activeTab = this.$route.query.type || 'myclientlist';
  },
  methods: {
    toCRMSetting() {
      this.$router.push({ name: 'CRMSetting' });
    }
  }

};
</script>

<style lang="scss" scoped>
.bu_position{
  position: absolute;
  right: 15px;
  top: 25px;
  z-index: 1;
}
</style>
